﻿Imports TNCDAL

Public Class frmVoyage_Temp

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Dim db As New TanNamChinhDataContext
        Dim rpt As New rptAdvanceVoucher
        Dim query2 = (From p In db.tblFileFees
                Where p.ID_AdvanceVoucher = Integer.Parse(txtID_AdvanceVoucher.Text)
                Select New With {
                    p.tblFee.FeeName, p.Price, p.ID_AdvanceVoucher
                                                     }).ToList()
        If query2.Count > 0 Then
            rpt.SetDataSource(HTLibrary.CollectionHelper.ConvertTo(query2))
            rpt.SetParameterValue("datePrint", Now.Date)
            rpt.SetParameterValue("fileNO", "123")
            rpt.SetParameterValue("contNO", "APZU 3391947")
            frmMain.AddNewDockContainerItem("PrintAdvanceVoucher", "Print Advance Voucher", New ucReportViewer(rpt))

            Dim frm As New FrmReport(rpt)
            frm.ShowDialog()
        End If

    End Sub
End Class